#include <iostream>

using namespace std;

class foo {
public:
        int a, b;
        static int count;
        foo() {count++;}
        ~foo() {count--;}
};

int foo::count = 0;

int main()
{
        foo bar;

        cout << foo::count << endl;

        foo *p = new foo;

        cout << foo::count << endl;

        delete p;

        cout << foo::count << endl;

        return 0;
}
